<template>
  <div class="todoList">
    <p class="list_title">事务中心</p>
    <div class="list_item">
      <!-- <li>
        <router-link :to="'/pur/order/0'+'?timestamp='+timestamp">
          <span>待发货</span>
          <span class="right_span ">
            <span class="mainColor">{{ viewData.waiting }}</span>
            <i class="el-icon-arrow-right grey" />
          </span>
        </router-link>
      </li>
      <li>
        <router-link :to="'/pur/order/1'+'?timestamp='+timestamp">
          <span>待收货</span>
          <span class="right_span ">
            <span class="mainColor">{{ viewData.waitEceiving }}</span>
            <i class="el-icon-arrow-right grey" />
          </span>
        </router-link>
      </li>
      <li>
        <router-link :to="'/pur/order/2'+'?timestamp='+timestamp">
          <span>待定价</span>
          <span class="right_span ">
            <span class="mainColor">{{ viewData.waitPricing }}</span>
            <i class="el-icon-arrow-right grey" />
          </span>
        </router-link>
      </li> -->
      <!-- <li>
        <router-link :to="'/pur/order/3'+'?timestamp='+timestamp" class="flex_box">
          <span>待核算</span>
          <span class="right_span ">
            <span class="mainColor">{{ viewData.waitAdjust }}</span>
            <i class="el-icon-arrow-right grey" />
          </span>
        </router-link>
      </li> -->
      <li>
        <router-link :to="'/pur/order/4'+'?timestamp='+timestamp" class="flex_box">
          <span>待结算</span>
          <span class="right_span ">
            <span class="mainColor">{{ viewData.waitPayment }}</span>
            <i class="el-icon-arrow-right grey" />
          </span>
        </router-link>
      </li>
    </div>
  </div>
</template>

<script>
import { purchaseTransaction } from '@/api/data'
export default {
  data() {
    return { viewData: {}}
  },
  computed: {
    timestamp: function() { return Date.parse(new Date()) }
  },
  created() {
    this.init()
  },
  methods: {
    async init() {
      var result = await purchaseTransaction()
      if (result.code === 200) this.viewData = result.data
    }
  }
}
</script>

<style lang="scss" scoped>
  .chart_view,.todoList{
    padding:20px;
    background: white;
    height: 420px;
  }
  .list_title{
    font-weight: bold;
  }
  .list_item{
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  // justify-content: space-between;
}
  .list_item::after{
   content: "";
   height: 0;
   width: 33%;
}
  .list_item li{
    width: 25%;
    font-size: 14px;
    border: 1px solid #eee;
    padding: 10px 15px;
    list-style-type:none;
    margin-bottom: 10px;
    cursor:pointer;
    margin-bottom: 40px;
    margin-right: 10px;
  }
  .flex_box{
    display: flex;
    justify-content: space-between;
  }
  .right_span{
    // margin-left: 80%;
    // float:right;
  }

</style>
